// https://blog.csdn.net/weixin_43692909/article/details/96450392?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&dist_request_id=&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control

#include<stdio.h>
#include"heap.h"

int bigger(int a, int b){
    return a > b;
}

int less(int a, int b){
    return a < b;
}

void printArray(int* arr, int len, const char* name){
    printf("%s @[%d]:", name, len);
    for(int i=0;i<len;i++) printf("%d ", arr[i]);
    printf("\n");
}

template<typename fn>
int compare(int a, int b, fn){

    return fn(a, b);
}

int main(){

    int lenght = 10;
    int arr[lenght] = {1, 0, 5, 10, 7, 43, 20, 18, 6, 9};
    printArray(arr, lenght, "Before");
    HeapSort2(arr, lenght, less);
    printArray(arr, lenght, "After");
}